package com.car.dal.dao.work;


import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.car.bean.GridObj;
import com.car.bean.OrderObj;
import com.car.bean.PageObj;
import com.car.dal.dao.ibatis.IbatisCommonDao;
import com.car.dal.object.TgWork;
import com.car.util.Page;

public class TgworkDaoImpl extends IbatisCommonDao<TgWork, Long> implements TgworkDao {

	public GridObj GetList(TgWork work, PageObj pageObj) {
		OrderObj order = new OrderObj();
		order.setDir("desc");
		order.setSort("createdate");
		// TODO Auto-generated method stub
		return super.findByPage(work, pageObj, order);
	}
	
	public List<TgWork> getTgWorkBytime(String username,String createdate) {
		Map<String, String> params=new HashMap<String, String>();
		params.put("username", username);
		params.put("createdate", createdate);
		List<TgWork> list=this.queryForEntityList(TgWork.class,"getWorkBytime", params);
		return list;
	}
	
	public Integer getWorkByTypeCount(TgWork work) {
		return this.queryForInteger("getWorkByTypeCount", work);
	}
	
	public List<TgWork> getWorkByType(TgWork work,Page page) {
		work.setFirstrownum(page.getFirstrownum());
		work.setPagesize(page.getPagesize());
		return this.queryForEntityList(TgWork.class,"getWorkByType", work);
	}
	
}
